package com.JZ.QM.controller;

import com.JZ.QM.common.entity.UserAccountEntity;
import com.JZ.QM.common.utils.CommonResult;
import com.JZ.QM.service.UserAccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: cyc
 * @email cyc@gmail.com
 * @date: 2020/7/11 22:01
 */
@RestController
@RefreshScope
@Slf4j
@RequestMapping(value="/userAccount")
public class UserAccountController {

    @Resource
    UserAccountService userAccountService;

    /**
     * 通过用户id获取用户的基本信息
     * @param userId 用户id
     * @return
     */
    @RequestMapping("/getUserAccountInfo")
    public CommonResult getUserAccountInfo(Long userId){
        //用户庄户基本信息
        UserAccountEntity userAccountEntity=new UserAccountEntity();

        //获取用户账户基本信息
        userAccountEntity=userAccountService.getAccount(userId);
        return CommonResult.success().put("userAccountInfo",userAccountEntity);
    }
}
